import java.util.Scanner;

public class Day_4_1_统计回文 {
    private static boolean isPalindrome(String s, String rever){
        return s.equals(rever);
    }
    private static int sovle(String stra, String strb){
        int n = stra.length();
        int m = strb.length();
        int count = 0;
        for(int i = 0; i <= n; i++){
            StringBuilder sb = new StringBuilder(n + m);
            sb.append(stra, 0, i);
            sb.append(strb);
            sb.append(stra, i, n);
            if(isPalindrome(sb.toString(), sb.reverse().toString())){
                ++count;
            }
        }
        return count;
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            String sa = sc.nextLine();
            String sb = sc.nextLine();
            System.out.println(sovle(sa,sb));
        }
    }
}
